#!/usr/bin/env python 
#-*-coding:utf-8-*-
#Author:
#Date:
#Version:

USER="huanggang"
PASSWD="123456"

def login():
    result = checkpasswd()
    for errornum in range(3):
        if result==0:
            print("Welcome!")
            break
        elif result==1:
            if errornum <2:
                print("User does not exist or password error,please re-enter !")
                result = checkpasswd()
            elif errornum==2:
                print("Password error more than 3 times, your account is locked")
                exit(1)

def checkpasswd():
    user=input("please enter user:")
    passwd=input("please your passwd:")
    if user==USER and passwd==PASSWD:
        return 0
    else:
        return 1


if __name__ == "__main__":
    print(sys.path)
    login()